package com.refusea.train.controller

import com.refusea.train.domain.entity.ClassGroup
import com.refusea.train.domain.helper.ClassGroupHelper
import com.refusea.train.domain.req.ClassGroupReq
import com.refusea.train.domain.vo.PaginationVo
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestBody
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

/**
 * @author Zhang Yan 2024/4/7
 **/
@RestController
@RequestMapping("/api/private/class_group")
class ClassGroupController(private val classGroupHelper: ClassGroupHelper) {

    @PostMapping("/list")
    fun list(@RequestBody req: ClassGroupReq): PaginationVo {
        return classGroupHelper.query(req)
    }

    @PostMapping("/save")
    fun save(@RequestBody req: ClassGroup): Int {
        return classGroupHelper.save(req)
    }

    @GetMapping("/delete")
    fun delete(id: Int) {
        classGroupHelper.delete(id)
    }

}
